USE [QLDL]
GO

/****** Object:  Table [dbo].[DAILY]    Script Date: 01/03/2011 15:19:24 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DAILY](
	[MaDaiLy] [nvarchar](10) NOT NULL,
	[TenDaiLy] [ntext] NULL,
	[MaLoaiDaiLy] [nvarchar](10) NULL,
	[MaQuan] [nvarchar](10) NULL,
	[DienThoai] [varchar](20) NULL,
	[DiaChi] [ntext] NULL,
	[Email] [varchar](50) NULL,
	[NgayTiepNhan] [date] NULL,
	[TienNo] [money] NULL,
 CONSTRAINT [PK_DAILY] PRIMARY KEY CLUSTERED 
(
	[MaDaiLy] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[DAILY]  WITH CHECK ADD  CONSTRAINT [FK_DAILY_MaLoaiDaiLy] FOREIGN KEY([MaLoaiDaiLy])
REFERENCES [dbo].[LOAIDAILY] ([MaLoaiDaiLy])
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[DAILY] CHECK CONSTRAINT [FK_DAILY_MaLoaiDaiLy]
GO

ALTER TABLE [dbo].[DAILY]  WITH CHECK ADD  CONSTRAINT [FK_DAILY_MaQuan] FOREIGN KEY([MaQuan])
REFERENCES [dbo].[QUAN] ([MaQuan])
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[DAILY] CHECK CONSTRAINT [FK_DAILY_MaQuan]
GO


